Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dialect selector #391

Merged
merged 2 commits into from
Sep 30, 2024
Merged

Fix dialect selector #391

merged 2 commits into from
Sep 30, 2024

Conversation

nolanbconaway
Copy link
Member

@nolanbconaway nolanbconaway commented Sep 30, 2024

fixes #389

I think there were changes introduced in sqlfluff/sqlfluff#6153 which changed the behavior of sqlfluff.list_dialects via dialect_readout, in which each dialect object's name became the formatted name:

sqlfluff/sqlfluff@2464d36#diff-910b0d8394425a99e2c2a292887f1ac6a981341b51147a76cc7f1b79907ce933L89

This name gets passed directly to sqlfluff.api.lint/fix functions, which caused errors because those functions expect labels. So the site has effectively been down for a few weeks without me noticing!

This pr extends the dialects config variables such that we store a mapping of names to labels. Frontend users see only the names, which are mapped back to the label on the backend. HTTP get calls can use either the name or the label (mostly so that all the old tests continue to pass).

I added some tests that either can be used, and that the automatic dialect selector continues to work.

@nolanbconaway nolanbconaway requested review from a team, pwildenhain and keraion and removed request for a team September 30, 2024 20:53
Copy link
Contributor

@greg-finley greg-finley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, and nice test!

@nolanbconaway nolanbconaway merged commit b7ad7f7 into master Sep 30, 2024
1 check passed
@nolanbconaway nolanbconaway deleted the nolan/fix-dialect-names branch September 30, 2024 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Website is down
2 participants